<!--<!DOCTYPE html>-->
<!--<html lang="en">-->
<!--<head>-->
<!--    <meta charset="UTF-8">-->
<!--    <title>Title</title>-->
<!--</head>-->
<!--<body>-->
<!--<div id="app">-->
<!--    <my-component></my-component>-->
<!--    <my-component></my-component>-->
<!--    <my-component></my-component>-->

<!--</div>-->
<!--<script src="https://unpkg.com/vue/dist/vue.min.js"></script>-->
<!--<script>-->
<!--    var data = {-->
<!--        counter:0-->
<!--    };-->

<!--    Vue.component('my-component',{-->
<!--        template:'<button @click="counter++">{{ counter }}</button>',-->
<!--        data:function(){-->
<!--            return data;-->
<!--        }-->
<!--    });-->

<!--    var app = new Vue({-->
<!--        el:'#app'-->
<!--    })-->
<!--</script>-->
<!--</body>-->
<!--</html>-->




<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <my-component></my-component>
    <my-component></my-component>
    <my-component></my-component>

</div>
<script src="https://unpkg.com/vue/dist/vue.min.js"></script>
<script>
    var data = {
        counter:0
    };

    Vue.component('my-component',{
        template:'<button @click="counter++">{{ counter }}</button>',
        data:function(){
            return {
                counter:0
            };
        }
    })

    var app = new Vue({
        el:'#app'
    })
</script>
</body>
</html>